//
//  InforTableViewCell.m
//  CloudMD
//
//  Created by apple on 16/2/18.
//  Copyright (c) 2016年 HuaZhengInfo. All rights reserved.
//

#import "InforTableViewCell.h"
#import "GYLAddImage.h"

@implementation InforTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self buildUI];
    }
    return self;
}

- (void)buildUI{

    UIView * view4 = [GDFactory creatUIViewWithFrame:CGRectMake(10, 0, SCR_W - 20, SCR_H/5) backColor:[UIColor whiteColor]];
    [view4.layer setBorderWidth:1.0];
    [view4.layer setBorderColor:RGBA(202, 202, 202, 1.0).CGColor];
    [self.contentView addSubview:view4];
    
    _addImageView = [[GYLAddImage alloc] initWithFrame:CGRectMake(0, 0, view4.frame.size.width * 0.5, view4.frame.size.height * 0.5)];
    
    [view4 addSubview:_addImageView];
    
//    UILabel * mainLabel = [GDFactory creatUILabelWithFrame:CGRectMake(10, 0, SCR_W - 100, SCR_H/7) text:@"添加图片" textColor:GARY textFont:[UIFont systemFontOfSize:18]];
//    mainLabel.backgroundColor = [UIColor whiteColor];
////    [mainLabel.layer setBorderColor:RGBA(202, 202, 202, 1.0).CGColor];
////    [mainLabel.layer setBorderWidth:1.0];
//    mainLabel.textAlignment = NSTextAlignmentCenter;
//    [view4 addSubview:mainLabel];
//    
//    UIButton * imageBtn = [GDFactory creatUIButtonWithFrame:CGRectMake(0, 0, 60, 60) backImage:@"add" title:nil titleLableColcor:nil titleLabelFont:nil];
//    imageBtn.center = CGPointMake(CGRectGetMaxX(mainLabel.frame) + 20,view4.frame.size.height * 0.5);
//    [imageBtn addTarget:self action:@selector(clickPhotoButtton) forControlEvents:UIControlEventTouchUpInside];
//    [view4 addSubview:imageBtn];
    

}

- (void)clickPhotoButtton{

    if ([_takePhotodelegate respondsToSelector:@selector(takePhoto)]) {
        [_takePhotodelegate takePhoto];
    }
}

- (void)clickPictureBtn{

    if ([_selectPictureDelegate respondsToSelector:@selector(selectPicture)]) {
        [_selectPictureDelegate selectPicture];
    }
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
